<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>
<title>主页</title>
<style type="text/css">
  td {
    text-align: center;
  }
</style>
</head>
<body>
  <span style="color: green">欢迎登录，${sessionScope['user-name']}！</span>
  <p>要更改密码，请输入原密码以及新密码</p>
  <form action="${pageContext.request.contextPath}/home" method="post">
    <table>
      <tr>
        <td>原密码</td>
        <td><input type="password" name="old-password"></td>
      </tr>
      <tr>
        <td>新密码</td>
        <td><input type="password" name="new-password"></td>
      </tr>
      <tr><td colspan="2"><button>更改密码</button></td></tr>
      <tr>
        <td><a href="${pageContext.request.contextPath}/logout">退出</a></td>
        <td><a href="${pageContext.request.contextPath}/cancel">注销</a></td>
      </tr>
    </table>
  </form>
  <c:if test="${error!=null}">
    <span class="error">${requestScope.error}</span>
  </c:if>
</body>
</html>
